package com.moana.job;

import java.sql.Connection;
import java.util.ArrayList;
import java.util.List;

import com.moana.buyTicket.cache.redis.TicketMapper;
import com.moana.buyTicket.cache.redis.TranFlowMapper;
import com.moana.buyTicket.dao.TicketDao;
import com.moana.buyTicket.entity.Ticket;
import com.moana.buyTicket.entity.TranFlow;

public class QuartzJob2 {
	TicketDao ticketDao;
	
	public void work(){
	    TicketMapper mapper = new TicketMapper();
		List<Ticket> susTickets = mapper.getTicketsSus(0, (int)mapper.lengthSus());
		TranFlowMapper tranFlowMapper = new TranFlowMapper();
		List<TranFlow> tranFlows = tranFlowMapper.getTranFlows(0, (int)tranFlowMapper.length());
		ticketDao.updateTickets(susTickets, tranFlows);
	}

	public TicketDao getTicketDao() {
		return ticketDao;
	}

	public void setTicketDao(TicketDao ticketDao) {
		this.ticketDao = ticketDao;
	}
}
